package com.kaili.common.aop;

import com.kaili.common.aop.log.service.LogService;
import com.kaili.common.pojo.entity.MdmSysLogEntity;
import com.kaili.common.pojo.entity.SysLoginLogEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 线程异步写日志任务
 * Created by zs on 18-7-12.
 */
@Component
public class LogAsyncTask {
    @Autowired
    private LogService logServiceImpl;

    @Async("logExecutor")
    public void saveLog(MdmSysLogEntity logBean, String collectionName){
        logServiceImpl.saveLog(logBean,collectionName);
    }

    @Async("logExecutor")
    public void saveLoginLog(SysLoginLogEntity logBean, String collectionName){
        logServiceImpl.saveLog(logBean,collectionName);
    }
}
